package com.ruoyi.leave.domain;

import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.util.List;

import com.baomidou.mybatisplus.annotation.TableId;
import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.*;

/**
 * 请假申请对象 leave_apply
 * 
 * @author ruoyi
 * @date 2024-09-24
 */

@Data
@Accessors(chain = true)
public class LeaveApply implements Serializable
{
    private static final long serialVersionUID = 1L;

    /** # */
    @TableId
    public Long id;

    /** 学号 */
    @Excel(name = "学号")
    public String stuNo;

    /** 申请时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "申请时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    public Date applyTime;

    /** 申请状态 */
    @Excel(name = "申请状态")
    public String applyStatus;

    /** 年级 */
    @Excel(name = "年级")
    @ApiModelProperty(value = "年级", required = true)
    public String grade;

    /** 专业 */
    @Excel(name = "专业")
    @ApiModelProperty(value = "专业", required = true)
    public String major;

    /** 请假原因 */
    @Excel(name = "请假原因")
    @ApiModelProperty(value = "请假原因", required = true)
    @NotBlank(message = "请假原因不能为空")
    @Length(max = 200, message = "请假原因不能超过200个字符")
    public String reason;

    /** 开始时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "开始时间", required = true)
    @NotNull(message = "开始时间不能为空")
    @FutureOrPresent(message = "开始时间不能为过去时间")
    public Date startTime;

    /** 结束时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "结束时间", required = true)
    @NotNull(message = "结束时间不能为空")
    @FutureOrPresent(message = "结束时间不能为过去时间")
    public Date endTime;

    /** 去向地址 */
    @Excel(name = "去向地址")
    @ApiModelProperty(value = "去向地址", required = true)
    @NotBlank(message = "去向地址不能为空")
    @Length(max = 200, message = "去向地址不能超过200个字符")
    public String toAddr;

    /** 家长姓名 */
    @Excel(name = "家长姓名")
    @ApiModelProperty(value = "家长姓名", required = true)
    @NotBlank(message = "家长姓名不能为空")
    @Length(max = 50, message = "家长姓名不能超过50个字符")
    public String parentName;

    /** 本人承诺 */
    @Excel(name = "本人承诺")
    @ApiModelProperty(value = "本人承诺", required = true)
    @NotBlank(message = "本人承诺不能为空")
    @Length(max = 200, message = "本人承诺不能超过200个字符")
    public String commit;

    /** 本人联系电话 */
    @Excel(name = "本人联系电话")
    @ApiModelProperty(value = "本人联系电话", required = true)
    @NotBlank(message = "本人联系电话不能为空")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "本人联系电话格式不正确")
    @Length(max = 12, message = "本人联系电话不能超过11个字符")
    public String phone;

    /** 去向地联络人 */
    @Excel(name = "去向地联络人")
    @ApiModelProperty(value = "去向地联络人", required = true)
    @NotBlank(message = "去向地联络人不能为空")
    @Length(max = 50, message = "去向地联络人不能超过50个字符")
    public String toPeople;

    /** 去向地联系电话 */
    @Excel(name = "去向地联系电话")
    @ApiModelProperty(value = "去向地联系电话", required = true)
    @NotBlank(message = "去向地联系电话不能为空")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "去向地联系电话格式不正确")
    @Length(max = 12, message = "去向地联系电话不能超过11个字符")
    public String toPhone;

    /** 辅导员意见 */
    @Excel(name = "辅导员意见")
    public String fdyCmt;

    /** 辅导员签字 */
    @Excel(name = "辅导员签字")
    public String fdySign;

    /** 辅导员工号 */
    @Excel(name = "辅导员工号")
    public String fdyNo;

    /** 辅导员审核时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "辅导员审核时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    public Date fdyTime;

    /** 学院领导意见 */
    @Excel(name = "学院领导意见")
    public String deptCmt;

    /** 学院领导签字盖章 */
    @Excel(name = "学院领导签字盖章")
    public String deptSign;

    /** 学院领导时间 */
    @Excel(name = "学院领导时间")
    public String deptNo;

    /** 学院领导审核时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "学院领导审核时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    public Date deptTime;

    /** 销假时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "销假时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    public Date takingTime;

    /** 销假签名 */
    @Excel(name = "销假签名")
    public String takingSign;

    /** 销假附件 */
    @Excel(name = "销假附件")
    public String takingMaterial;

    public String returnMsg;

    /** 是否有课程 */
    @NotBlank(message = "请选择是否有课程")
    public String haveCourse;

    /** 家长知情同意书 */
    @NotBlank(message = "请上传家长知情同意书")
    public String parentKnow;

    @TableField(exist = false)
    public String stuName;

    @TableField(exist = false)
    public String className;

    @TableField(exist = false)
    public String teacherName;

    @TableField(exist = false)
    public String teacherNo;

    @TableField(exist = false)
    public List<LeaveApplyCourse> courseList;

    @TableField(exist = false)
    public String startTimeStr;

    @TableField(exist = false)
    public String endTimeStr;

    @TableField(exist = false)
    public String gradeName;

    @TableField(exist = false)
    public Long leaveCount;

    @TableField(exist = false)
    public String majorName;


}
